PA5 read and write problems in OpenController

Tech Note: TN0867
Product: OpenController
Version: All
Date Added: 2009-12-01

Issue

Device reading issues:

Standard displays or indicators (such as Value Watch or 7-segment display) in OpenController can't monitor the attenuation level of a PA5. Setting the control to monitor the attenuation level target (PA5_1.Atten) results in the control reading a constant value of 0.

Device writing issues:

Using the "Write_" command in the VBScriptEx component doesn't work correctly; for example, Write_("PA5_1.Atten", 50) should set PA5_1 to 50 dB attenuation but is unresponsive. Standard controls such as Value Inputs and Sliders, however, can still be used to change the attenuation level.

Workaround

Device reading workaround:

Use a VBScriptEx control to read the PA5 attenuation level and write it to the display or indicator control. For example, if there is a 7-segment display called "LED_Atten1" and a PA5 called "PA5_1" then use the following VBScriptEx code to read the attenuation level and write it to the display:

While 1
    Write_(">LED_Atten1", Read("PA5_1.Atten"))
    Sleep(100)
WEnd

Device writing workaround:

Insert an Input Box into your OpenController workspace, call it "PA5temp" and set it's target to "PA5_1.Atten". In your VBScriptEx code, whenever you want to change the attenuation, write to the PA5temp control. For example, to set the attenuation to 50 dB, use:

Write_(">PA5temp",50)